
<template>

    <view class="store-manage">

          <view class="top-bg"></view>
          <view class="store-container">
              <ShopInfo :d="shopInfo" v-if="Object.keys(shopInfo).length" />
              <view class="store-wallet">
                    <view class="label">我的钱包</view>
                    <view class="money">￥{{shopInfo.userBalance || 0}}</view>
              </view>

              <view class="my-store">
                  <view class="title">我的店铺</view>
                  <view class="list">
                      <view class="item" @tap="toGoodsManage">
                          <image src="/static/images/store_icon_01.png" />
                          <view class="text">商品管理</view>
                      </view>
                       <view class="item" @tap="toOrderList">
                          <image src="/static/images/store_icon_02.png" />
                          <view class="text">订单查询</view>
                      </view>

                         <view class="item">
                           <navigator :url="`/finance/pages/cashBook/index?salonId=${salonId}`" hover-class="none">
                              <image src="/static/images/store_icon_03.png" />
                              <view class="text">交易明细</view>
                           </navigator>
                      </view>

                       <view class="item" @tap="toRelease">
                         
                          <image src="/static/images/store_icon_04.png" />
                          <view class="text">文章发布</view>
                      
                      </view>

                  </view>
              </view>


                  <view class="my-store">
                  <view class="title">店铺装修</view>
                  <view class="list">
                      <view class="item">
                         <navigator :url="`/pages/setBgColor/index?salonId=${salonId}`" hover-class="none">
                          <image src="/static/images/store_icon_21.png" />
                          <view class="text">店铺皮肤</view>
                         </navigator> 
                      </view>
                       <view class="item">
                          <navigator :url="`/pages/upLogo/index?salonId=${salonId}`" hover-class="none">
                            <image src="/static/images/store_icon_22.png" />
                            <view class="text">店铺logo</view>
                          </navigator>
                      </view>

                       <view class="item" >
                           <navigator :url="`/pages/addAd/index?salonId=${salonId}`" hover-class="none">
                              <image src="/static/images/store_icon_23.png" />
                              <view class="text">店铺广告</view>
                           </navigator>
                      </view>
                       <view class="item" >
                          <navigator :url="`/pages/shopIntro/index?salonId=${salonId}`" hover-class="none">
                            <image src="/static/images/store_icon_24.png" />
                            <view class="text">品牌介绍</view>
                          </navigator>
                      </view>
                  </view>   
                  <view class="list"> 
                       <view class="item" >
                           <navigator :url="`/pages/setBusinessHours/index?salonId=${salonId}`" hover-class="none">
                            <image src="/static/images/store_icon_25.png" />
                            <view class="text">营业时间</view>
                           </navigator>
                      </view>

                        <!-- <view class="item" >
                          
                            <image src="/static/images/store_icon_26.png" />
                            <view class="text">营业地址</view>
                       
                      </view> -->

                       <view class="item">
                           <navigator :url="`/pages/shopIndex/index?salonId=${salonId}`" hover-class="none">
                              <image src="/static/images/store_icon_27.png" />
                              <view class="text">店铺预览</view>
                          </navigator>
                      </view>

                     

                  </view>
              </view>




          </view>

    </view>

</template>

<script lang="ts">

  import ShopInfo from './_components/shopInfo.vue' 
  import {postbBautySalonDetails} from '@/request/actions'
  import {Vue, Component } from 'vue-property-decorator';


  @Component({
     components:{
      ShopInfo
    }
  })
  export default class extends Vue{
    
      shopInfo:any = {};
      salonId:string = '';
   
        toRelease(){
            let salonId =  this.salonId;
            uni.navigateTo({
              url:`/pages/release/index?salonId=${salonId}`
            })

        }
        toGoodsManage(){
          uni.navigateTo({
              url:`/pages/goodsManage/index`
            })
        }
        toOrderList(){
           uni.navigateTo({
              url:`/subPackages/pages/storebeautyOrderList/index?orderstartid=null`
            })
        }
       
        loadData(){
           let globalData = getApp().globalData;
           let {userId} = globalData.userInfo;
           let salonId = this.salonId;
           postbBautySalonDetails({userId,salonId}).then((r:any)=>{
                  let {data:res} = r;
                  if(res.status == 200){
                      this.shopInfo = res.data.stulist;
                    // this.$broadcast('getShopInfo',this.shopInfo);
                  }
                
                  uni.stopPullDownRefresh();
                  
              }) 
        }

    

    onLoad(query:any){
     
      let {salonId} = query;

      this.salonId = salonId;
      this.loadData();

     

      

    }


      onPullDownRefresh(){
        
             //   this.onLoad({salonId:this.salonId});
              this.loadData();
        }


  }
</script>
<style lang="scss">
  @import './_static/scss/index.scss';

</style>